package com.example.lib_http

import com.zyj.retrofit.adapter.FlowCallAdapterFactory
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory

class TokenRetrofitImpl:BaseRetrofitImpl() {
    override fun createRetrofit(): Retrofit {
        return Retrofit.Builder()
            .baseUrl(Const.BASE_URL)
            .client(createHttp().addInterceptor { chain ->
                chain.proceed(
                    chain.request().newBuilder()
                        .addHeader(Const.PARAM_TOKEN,"").build()
                )
            }.build())
            .addConverterFactory(GsonConverterFactory.create())
            .addCallAdapterFactory(FlowCallAdapterFactory.create())
            .build()
    }
}